import { Component, ViewChild } from '@angular/core';
import { NzToolTipComponent } from 'ng-zorro-antd/tooltip';
import {InputConfig ,ButtonConfig  } from "@src/app/model/jack.model";

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})


export class AppComponent {


  @ViewChild('btsheet1',{static:false})
  btsheet1;
  title = 'p1';
  show=true;
  aa="aa"
  
  list = [{
    name:'aa'
  }, {
    name:'bb'
  }]
  opensheet() {
    this.btsheet1.open()
  }

  @ViewChild('tooltip',{static: false}) 
  tooltip:NzToolTipComponent;

  @ViewChild('modal1',{static:false})
  modal1;

  modalbtn:ButtonConfig;
  ngOnInit(){
    
  }
  ngAfterViewInit() {
    let self = this;
    this.modalbtn= {
      onclick() {
        console.log(self.modal1)
      }
    }
    // this.tooltip.show()
  }
  

  onSend(dd) {
    console.log('this is parent', dd)
  }
  callservice():void {
    console.log('call service')
  }

  onsuccess(res) {
    console.log('----', res)
  }
  // conf ={}
  btn:ButtonConfig = {
    onclick() {
      console.log('click')
    }
  }

  inputconf:InputConfig = {
    onchange() {
      console.log('onchange')
    }
  }
  
  conf:ButtonConfig = {
    requestName:'test',
    loadingText:'loading...',
    // 最好不要穿入html不然容易出错
    onclick() {
      console.log('this will invoke something')
    },
    onsuccess(res) {
      console.log(res)
    },
    onfail(res){
      console.log(res)
      alert(res.status)
    }
    
  }
}
